<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:cc="http://java.sun.com/jsf/composite">
	
	
	
	    <cc:interface>

	    <cc:attribute name="renderedSalvar" required="true"/>
	    <cc:attribute name="renderedAlterar" required="true"/>
	    <cc:attribute name="renderedLimpar" required="true"/>
	    <cc:attribute name="renderedFechar" required="true"/>
	    <cc:attribute name="update" required="true"/>
	    
        </cc:interface>
	
	
	<cc:implementation>
 <div style="width:420px" >
               <fieldset>
                   <legend style="margin-left: 5px;">Dados Gerais</legend>
                   <div style="margin-top: 10px; margin-left: 8px; margin-bottom: 10px;">    
                   <h:panelGrid columns="2">
 				    <h:column><div style="width:60px"><h:outputText for="nome"   value="Nome: "  /><span style="color: red">*</span></div></h:column>
				    <h:column>	
				        <p:inputText  style="width:302px;"
				            id="nome"
							value="#{profissionalMBean.profissional.nome}"
							required="true"
							requiredMessage="O campo 'Nome' é obrigatório!"
							maxlength="33"
						/>
					</h:column>
 				    <h:column><div style="width:60px"><h:outputText for="funcao"   value="Função: "  /><span style="color: red">*</span></div></h:column>
				    <h:column>	
				        <p:inputText  style="width:302px;"
				            id="funcao"
							value="#{profissionalMBean.profissional.funcao}"
							required="true"
							requiredMessage="O campo 'Função' é obrigatório!"
							maxlength="44"
						/>
					</h:column>					
					</h:panelGrid>	
					
									
					<h:panelGrid columns="4">
 				    <h:column><div style="width:60px"><h:outputText for="rg" value="RG: "  /><span style="color: red">*</span></div></h:column>
				    <h:column>	
				        <p:inputText  style="width:110px;"
				            id="rg"
							value="#{profissionalMBean.profissional.rg}"
							required="true"
							requiredMessage="O campo RG é obrigatório!"
							maxlength="20"
						/>
					</h:column>
 				    <h:column><div style="width:50px; padding-left: 15px"><h:outputText for="cpf" value="CPF: "  /><span style="color: red">*</span></div></h:column>
				    <h:column>	
						<p:inputMask style="width:109px;"
						    id="cpf"
							value="#{profissionalMBean.profissional.cpf}"
							required="true"
							requiredMessage="O campo CPF é obrigatório!"
							maxlength="45"
							 mask="999.999.999-99"/>
					</h:column>										
					</h:panelGrid>
	
	
					<h:panelGrid columns="4">
 				    <h:column><div style="width:60px"><h:outputText for="telRes" value="Tel Res: "  /></div></h:column>
				    <h:column>	
				        <p:inputMask  style="width:110px;"
				            id="telRes"
							value="#{profissionalMBean.profissional.telefoneRes}"
							maxlength="45"
							mask="(999)9999-9999"
						/>
					</h:column>
 				    <h:column><div style="width:50px; padding-left: 15px"><h:outputText for="celular" value="Celular: "  /></div></h:column>
				    <h:column>	
				        <p:inputMask  style="width:109px;"
				            id="celular"
							value="#{profissionalMBean.profissional.celular}"
							maxlength="10"
							mask="(999)9999-9999"
						/>
					</h:column>										
					</h:panelGrid>	
	
					<h:panelGrid columns="4">
 				    <h:column><div style="width:60px"><h:outputText for="telCom" value="Tel Com: "  /></div></h:column>
				    <h:column>	
				        <p:inputMask  style="width:110px;"
				            id="telCom"
							value="#{profissionalMBean.profissional.telefoneCom}"
							maxlength="45"
							mask="(999)9999-9999"
						/>
					</h:column>
 				    <h:column><div style="width:50px; padding-left: 15px"><h:outputText for="ramal" value="Ramal: "  /></div></h:column>
				    <h:column>	
				        <p:inputText   style="width:109px;"
				            id="Ramal"
							value="#{profissionalMBean.profissional.ramal}"
							maxlength="9"
						/>
					</h:column>										
					</h:panelGrid>



                    <h:panelGrid columns="2">
 				    <h:column><div style="width:60px"><h:outputText for="email"   value="Email: "  /></div></h:column>
				    <h:column>	
				        <p:inputText  style="width:302px;"
				            id="email"
							value="#{profissionalMBean.profissional.email}"
							required="true"
							requiredMessage="O campo 'Email' é obrigatório!"
							maxlength="45"
						/>
					</h:column>
					</h:panelGrid>	
					</div>
			</fieldset>


            <fieldset>
                   <legend style="margin-left: 5px;">Dados do Sistema</legend>
                   <div style="margin-top: 10px; margin-left: 8px; margin-bottom: 10px;">
                   <h:panelGrid columns="4">
  
 				    <h:column><div style="width:60px"><h:outputText for="login"   value="Login: "  /><span style="color: red">*</span></div></h:column>
				    <h:column>	
				        <p:inputText  style="width:110px;"
				            id="login"
							value="#{profissionalMBean.profissional.login}"
							required="true"
							requiredMessage="O campo 'Login' é obrigatório!"
							maxlength="20"
						/>
					</h:column>
						

					<h:column><div style="width:50px; padding-left: 15px"><h:outputText for="Unidade"   value="Unidade: "  /><span style="color: red">*</span></div></h:column>
				     <h:column>					
					<h:selectOneListbox size="1" value="#{profissionalMBean.idUnidade}" id="Unidade" style="width:113px;" required="true" requiredMessage="Campo 'Unidade' de preenchimento obrigatório " >
                       <f:selectItem itemValue="0" itemLabel="Selecione..." />
                       <f:selectItems value="#{profissionalMBean.listaFaceUnidade}" />
                    </h:selectOneListbox>
					</h:column>		
					
					<h:column><div style="width:60px"><h:outputText for="status"   value="Status: "  /><span style="color: red">*</span></div></h:column>
				     <h:column>
						<h:selectOneListbox size="1" value="#{profissionalMBean.profissional.status}" id="status" style="width:119px;">
							<f:selectItem id="habilitado" itemLabel="Habilitado" itemValue="Habilitado" />
							<f:selectItem id="desativado" itemLabel="Desativado" itemValue="Desativado" />
						</h:selectOneListbox>
					</h:column>
				        
                   </h:panelGrid>
                   </div>
			</fieldset>


				<p:separator style="width:380px; height:1px;" />
				<div style="text-align: right">

				   <p:commandButton
				    value="Salvar"
				    type="push" 
					action="#{profissionalMBean.salvar}"
					update="#{update}"
					rendered="#{renderedSalvar}"
					image="ui-icon-disk"
				   />
				   <p:commandButton
				    value="Alterar"
				    type="push" 
					action="#{profissionalMBean.alterar}"
					update="#{update}"
					rendered="#{renderedAlterar}"
					image="ui-icon-disk"
				   />				   
				   <p:commandButton
				    value="Limpar"
				    type="reset" 
					image="ui-icon-disk"
					rendered="#{renderedLimpar}"
				   />
				   <p:commandButton
				    value="Fechar"
				    type="push" 
				    oncomplete="alteracao.hide()"
					image="ui-icon-disk"
					rendered="#{renderedFechar}"
				   />					   				   
				</div>

</div>
</cc:implementation>
</html>